﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SoundServant.Controls
{
    /// <summary>
    /// Interaction logic for ResultControl.xaml
    /// </summary>
    public partial class ResultControl : UserControl
    {
        public readonly Result Result;


        public delegate void ResultSelectedHandler(ResultControl result);
        public event ResultSelectedHandler Selected;

        public ResultControl(Result r)
        {
            InitializeComponent();

            Result = r;
            DateTime.Content = "[" + Result.Id + "] " + Result.Date.ToString("ddd d MMMM yyyy HH:mm");
            MeetingTypeLabel.Content = SS.FullMeetingType(Result.Type);
            RecordingSummary.Text = Result.TrackListing;
        }

        public void Unselect()
        {
            ResultBorder.Background = Brushes.Transparent;
        }

        private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
        {
            ResultBorder.Background = Brushes.White;
            Selected(this);
        }
    }
}
